import request from "@/utils/request";
import { Dashboard, Login, ResultData, User, Pagination } from "@/types/api";
const login = (params: Login.params) => {
    return request.post<string>("/users/login", params, { showLoading: false, showError: false });
};
//获取用户信息
const getUserInfo = () => {
    return request.get<User.UserItem>("/users/getUserInfo");
};
//获取工作台汇总数据
const getReportData = () => {
    return request.get<Dashboard.ReportData>("/order/dashboard/getReportData");
};
//获取折线图数据
const getLineData = () => {
    return request.get<Dashboard.LineData>("/order/dashboard/getLineData");
};
//获取饼状图数据
const getPieCityData = () => {
    return request.get<Dashboard.PieData[]>("/order/dashboard/getPieCityData");
};
//获取饼状图数据
const getPieAgeData = () => {
    return request.get<Dashboard.PieData[]>("/order/dashboard/getPieCityData");
};
//获取雷达图数据
const getRadarData = () => {
    return request.get<Dashboard.RadarData>("/order/dashboard/getRadarData");
};
//获取用户列表
const getUserList = (params: User.Params & Pagination.paginationProps) => {
    return request.get<ResultData<User.UserItem>>("/users/list", params);
};
export { login, getUserInfo, getReportData, getLineData, getPieCityData, getPieAgeData, getRadarData, getUserList };
